package com.jjyu.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jjyu.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where name = #{userName}")
    User findByUserName(String userName);

    @Insert("insert into user(name, email, password,points,created_at,updated_at) " +
            "values(#{name}, #{email}, #{password},0,CURRENT_TIME,CURRENT_TIME)")
    int addUser(String name, String email, String password);
}